feat: add capability checker for feature-level permissions#1
Merged
n-hallberg merged 1 commit intoamadeni:mainfrom Mar 13, 2026
Merged
feat: add capability checker for feature-level permissions#1n-hallberg merged 1 commit intoamadeni:mainfrom
n-hallberg merged 1 commit intoamadeni:mainfrom
Conversation
c443b39 to
9da8165
Compare
Adds two features:
1. createCapabilityChecker() - generic capability system for feature-level permissions
- Registry-based default roles per capability
- DB overrides that take precedence over defaults
- Admin role bypass, checkAll() for bulk checks
- Based on impuls-kbb capability pattern, genericized for reuse
2. publicQuery / publicMutation / publicAction - explicit unauthenticated builders
- Thin wrappers around generic Convex builders
- Makes intent explicit: 'this endpoint is intentionally public'
- Enables CI auth-enforcement: flag raw _generated/server imports,
allow publicQuery as the sanctioned bypass
9da8165 to
7e5c782
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
createCapabilityChecker()— a generic capability system for feature-level permissions.Based on the capability pattern from impuls-kbb (
capabilities/helpers.ts+capabilities/registry.ts), genericized for reuse across all Amadeni projects.API
Features
checkAll(): Bulk check for admin panels / capability overview UIsTests
6 new tests covering admin bypass, default roles, DB overrides, custom admin roles, checkAll, and key exposure.